
(defmacro eval-and-print (expr)
  `(format t "~4tresult of ~a = ~a~%" ',expr ,expr))

; =================================================
; helper routine for 'shorthands' function
(defun checks-for-list (l)
  (eval-and-print (loop for x in l thereis (numberp x)))
  (eval-and-print (loop for x in l never (numberp x)))
  (eval-and-print (loop for x in l always (numberp x))))


; =================================================
; illustrates quick loop-based checks
(defun shorthands ()
  (let ((sample-input-list
          '(
            (1 2 3)
            (foo 1)
            (a b)
            )))
    (loop for sample-list in sample-input-list
          do (progn
               (format t "results for ~a:~%" sample-list)
               (checks-for-list sample-list)))))



(defun collect-test ()
  (loop for a from 0 below 10
        for b from 100
        collect (list a b)))

(defun return-test (element)
  (let ((l '(1 2 3)))
        (loop for x in '(1 2 3)
              when (= x element)
              return (+ x 1000)))
  )

